Release 10.1A: OpenEdge Development:
Web Services
SOAP header structure
The following XML contains a SOAP header as it might appear inside a SOAP message:
As you can see, the
<Header>element is, itself, nothing more than a container for other elements, the application-specific header entry elements. Any parameters generated for an operation in this SOAP message appear in the<Body>element in much the same way.In this case, the SOAP header contains two header entries, named
q1:OrderInfoIDandt:Transaction(whereq1:andt:are namespace prefixes). Each of these elements has a series of attributes and contains one or more child elements. The<q1:OrderInfoID>element contains one child element nameduuid, and the<t:Transaction>element contains two child elements, namedt:TransIDandt:SubID. All of these element names are application-defined.Accessing the SOAP header
To access the SOAP header and its elements from your 4GL application, you define callback procedures using specific signatures to use as header handlers, depending on whether the procedure is used to access a SOAP response header or a SOAP request header. As a minimum, you might not have to access message headers at all. If you need to access the headers, you can define one header handler to manage all of the SOAP request headers and another header handler to manage all of the SOAP response headers that are generated for operations of a single Web service procedure object. You can specify the handlers for a Web service procedure object by invoking the
SET-CALLBACK-PROCEDURE( )method on the corresponding procedure handle. If you want to add additional handlers for the same port type managed by a Web service procedure object, you must map the port type using additional procedure objects. For more information, see the information on specifying header callback procedures in Chapter 10, " Invoking Web Service Operations from the Progress 4GL."Every time you invoke an operation for a port type where you have specified header handlers, the handlers execute as part of the operation invocation. They intercept and manage the SOAP headers as part of sending a SOAP request message, before the message is sent to the Web service, and as part of receiving a SOAP response message, before any message parameters are passed to complete invocation of the operation.
Requirements for header handlers
Note that there is no absolute requirement to use header handlers. The need for managing headers depends entirely on the requirements of the Web service that you are accessing. You can also set and reset the callbacks for header handlers as often as you need to specify the correct handlers for different operations and port types, add additional header handlers for a single port type by mapping the port type to additional Web service procedure objects, and you can remove any previously specified callbacks entirely when you have no need to handle the SOAP headers for an operation or port type. The only absolute requirement for a header handler is the signature that you must use to define it.
For more information on:
- How to specify callback procedures as header handlers, see Chapter 10, " Invoking Web Service Operations from the Progress 4GL."
- The general cycle of operation for header handlers in the 4GL, see the "Invoking a header handler" section.
- Defining the callback procedures for header handlers, see the "Defining header handlers" section.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |